/* The Stat class holds various variables that other classes can use in their calculations.
 *
 * Important!! Note that the CharacterStats class will create Stat classes on its own through its custom editor, 
 * there is no need to add stat components by hand. Simply add the characterStats class for handling this.
 *
 * Author : Reinier
 */

public var amount : int;		/* The current amount of the stat */
public var baseAmount : int;	/* The baseamount of the stat */
public var growth : float;		/* The growth factor, if set as 0 or 1, the stat will not grow by level */
public var statName : String;	/* The name for this stat */

/* On awaking the amount is simply the baseAmount, any influences will be done after */
function Awake() {
	amount = baseAmount;
}

/* The UpdateAmount function increases the amount based on the growth factor and a level integer
 *
 * The formula : baseAmount * growth^level
 */
function UpdateAmount(level : int) {
	//Formula for increasing a stat:
	//Baseamount * growth^level
	amount = baseAmount * Mathf.Pow(growth, level);
}

/* Simple getter for the baseAmount */
function GetBase() {
	return baseAmount;
}

/* Simple getter for the Amount */
function GetAmount() {
	return amount;
}

/* Simple getter for the name */
function GetName() {
	return statName;
}

/* Simple getter for the growth */
function GetGrowth() {
	return growth;
}

/* Simple setter for the baseAmount */
function SetBase(newBase : int) {
	baseAmount = newBase;
}


/* Simple setter for the Amount */
function SetAmount(newAmount : int) {
	amount = newAmount;
}

/* Simple setter for the name */
function SetName(newName : String) {
	statName = newName;
}

/* Simple setter for the growth */
function SetGrowth(newAmount : float) {
	growth = newAmount;
}
